Add long button press threshold as a user setting#246
Add long button press threshold as a user setting#246Msprg wants to merge 1 commit intoRfidResearchGroup:mainfrom
Conversation
|
You are welcome to add an entry to the CHANGELOG.md as well |
|
nice, looks good. Due to "missmanagement" (RRG not giving a fuck and kinda not even existing anymore as they split or smthng, etc) i doubt itll be merged here... May i merge it on my fork (where i attempt to revive this project a bit)? (https://github.com/ChameleonUltra/ChameleonUltra) |
Oh, yeah, I was noticing something was off for a pretty long time lately. If you'd happen to know something more about it, I'd be thrilled if you could chat with me about it, as I'm not exactly sure I'd want to go asking iceman and others. But I digress...
Of course! That would be very much appreciated! |
|
Are you sure we need to store this value as a The button press duration is already constrained — with an upper limit around Here’s a suggestion for how it could look: uint16_t settings_get_long_press_threshold(void) {
return config.long_press_threshold * 16;
}
void settings_set_long_press_threshold(uint16_t duration) {
// Clamp value to valid range: 200 ms minimum, SLEEP_DELAY_MS_BUTTON_CLICK maximum
if (duration < 200) {
duration = 200;
}
if (duration > SLEEP_DELAY_MS_BUTTON_CLICK) {
duration = SLEEP_DELAY_MS_BUTTON_CLICK;
}
// Store in 16 ms resolution units
config.long_press_threshold = duration / 16;
} |
|
Hi @Msprg , In near future I see two PRs should be merged. hardnested is implemented and viking support. Could you take a look at comment from @unkernet and update the PR afterwards? |
I've tested the changes on my own chameleon devices to the best of my abilities. Feel free to suggest changes.